/*
  ation 类型
 */
export const TOGGLE_PLAY = 'TOGGLE_PLAY';
export const CHANGE_PROGRESS = 'CHANGE_PROGRESS';
export const CHANGE_VOLUME = 'CHANGE_VOLUME';
export const LEFTTIME = 'LEFTTIME';
export const PREV_MUSIC = 'PREV_MUSIC';
export const NEXT_MUSIC = 'NEXT_MUSIC';


/*
  其他变量
 */
export const DefaultValues = {
  progress: '-',
  volume: 0,
  isPlay: false,
  leftTime: ''
}

export function togglePlay(index) {
  return { type: TOGGLE_PLAY, index }
}

export function changeProgress(prog) {
  return { type: CHANGE_PROGRESS, prog }
}

export function changeVolume(vu) {
  return { type: CHANGE_VOLUME, vu }
}

export function leftTime(time) {
  return { type: LEFTTIME, time }
}

export function prevMusic(index) {
  return { type: PREV_MUSIC, index }
}

export function nextMusic(index) {
  return { type: NEXT_MUSIC, index }
}
